< previous page page_626 next page >

Page 626
AlignmentThis property controls how values in a given column are aligned.
WidthThis property sets the width of the specified column. (An easier way to set column widths is to use the editing mode described earlier and resize them using the mouse.)
0626-01.jpg
Figure 28.14
Here is the Layout tab of the DataGrid's Property Pages
0626-02.jpg
Figure 28.15
The leftmost split has the 
WrapText property set to True.
Customizing the Grid with Code
In learning about the DataGrid, you have concentrated on setting properties in the design environment. However, almost everything you have learned about the properties of the DataGrid can also be applied to the runtime environment. For example, if you want to set the WrapText property of the first column in the first split, use the following line of code:
datagrid1.Splits(0).Columns(0).WrapText  = True
Although you may have to navigate through a few levels of collections to get to the property you want, you will find that most properties can be changed with code.

 
< previous page page_626 next page >